package com.xianggu.protocol.server;

import com.xianggu.protocol.EnumConstants;
import com.xianggu.protocol.HttpServletHandler;
import com.xianggu.protocol.RpcServletHandler;
import com.xianggu.spring.XiangGuApplicationContent;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author chengjy
 * @date 2025/3/8
 */
public class XiangguRPCServlet extends HttpServlet {

    private XiangGuApplicationContent applicationContent;

    public XiangguRPCServlet(XiangGuApplicationContent applicationContent) {
        this.applicationContent = applicationContent;
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        new RpcServletHandler(applicationContent).handler(req , resp);

    }
}
